const tester = document.createElement('div');
tester.className = 'tester';

function switchQrcode(){
  tester.classList.toggle('hidden');
  document.querySelector('.wechat').classList.toggle('hidden');
}

const phoneNumber = document.createElement('p');
phoneNumber.className = 'scanTitle';
phoneNumber.innerText = '　微信扫一扫';
phoneNumber.onclick = switchQrcode;

const description = document.createElement('p');
description.innerText = '　快速咨询';

const image = document.createElement('img');
image.src = 'img/qrcode.jpg';
image.style.width = '95%';
image.style.margin = '5px';

tester.appendChild(phoneNumber);
tester.appendChild(description);
tester.appendChild(image);

document.addEventListener('DOMContentLoaded', function () {     
  document.body.appendChild(tester);
});